<!DOCTYPE HTML>

<html lang="utf-8">
<head>
<meta charset="utf-8">
<title>驾车宝典-注册</title>
<link href="${ctx}/styles/group.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/user.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/loginNReg.css" rel="stylesheet" type="text/css">
<#include '/baseHead.ftl'>

<!--主要部分开始-->
<section id="main"><div class="bgA_01">
	
	<div class="loginNRegPanel_01">
		<div class="formField">
			<nav class="menu">
				<ul>
					<li><a href="${ctx}/member/reg" title="点击注册">创建踏客帐号</a></li>
					<li><a class="on" href="#" title="点击登录">我已有踏客帐号</a></li>
				</ul>
			</nav>
			<div class="list">
				<ul>
					<li class="id"><input type="text" class="txt" value="" id="loginName"></li>
					<li class="pw"><input type="password" class="txt" value="" id="password"  onkeydown="checksub(event.keyCode);" ></li>
					<!--
					<li class="code">验证码：<input type="text" class="txt"></li>
					-->
				</ul>
			</div>
			<div class="info" id="infodiv" style="display:none" >
				<button class="btn close" title="关闭" onclick='closea();'></button>
				<span id="ccc">aa</span>	  
			</div>
			<div class="btns">
				<button class="btn btn2" title="点击登录" onclick='login();'>登录</button>
			</div>
		</div>
		<div class="btnField">
			<ul>
			<!--
				<li><a href="#" class="btn btn1" title="用微博帐号登录">用微博帐号登录</a></li>
				<li><a href="#" class="btn btn2" title="用QQ帐号登录">用QQ帐号登录</a></li>
				--><!--
				<li><a href="#" class="btn btn3" title="用豆瓣帐号登录">用豆瓣帐号登录</a></li>
				<li><a href="#" class="btn btn4" title="用人人帐号登录">用人人帐号登录</a></li>
				<li><a href="#" class="btn btn5" title="用腾讯微博帐号登录">用腾讯微博帐号登录</a></li>
				<li><a href="#" class="btn btn6" title="用MSN帐号登录">用MSN帐号登录</a></li>
				-->
			</ul>
		</div>
	</div>
		<#include '/commonFriendLink.ftl'>
</div></section>
<!--主要部分结束-->
<!--主要部分结束-->
<#include '/baseFoot.ftl'>
<script>
function checksub(e) {
		if (e == 13) {
			login();
		}
	}
	function getVerifyCode(){
		if ( $('#loginName').val()  == "" ){
			alert("请输入手机或者邮箱作为登录名");
			return ;
		}
		if ( $('#nickName').val()  == "" ){
			alert("请输入昵称");
			return ;
		}
		if ( $('#password').val()  == "" ){
			alert("请输入密码");
				return ;
		}
		if ( $('#repassword').val()  == "" ){
			alert("请重复密码");
				return ;
		}
		if (  $('#password').val()  != $('#repassword').val()   ) {
			alert("两次密码输入不一致");
			return ;
		}
		$.ajax({
		 			type: "get",
					url: "${ctx}/member/getverifycode",
					beforeSend: function(XMLHttpRequest){
					//ShowLoading();
					},
					success: function(data, textStatus){
						if ( data.state == 1){
							alert("验证码已发送,请查看");
						}else{
							alert(data.desc);
						}
					},
					data:{
						loginName:$('#loginName').val() ,
						password:$('#password').val() 
					},
					dataType:'json'
				}
	 		)
	}
	function login(){
			if ( $('#loginName').val()  == "" ){
			$('#infodiv').css("display","block");
			$('#ccc').html("请输入手机或者邮箱");  
			return ;
		}
		if ( $('#password').val()  == "" ){
			$('#infodiv').css("display","block");
			$('#ccc').html("对不起,请输入密码");  
			return ;
		}
		$.ajax({
		 			type: "get",
					url: "${ctx}/member//ajaxlogin",
					beforeSend: function(XMLHttpRequest){
					//ShowLoading();
					},
					success: function(data, textStatus){
						if ( data.state == 1){
							window.location.href = "${ctx}/member/login/success";
						}else{
							alert(data.desc);
						}
					},
					data:{
						loginName:$('#loginName').val() ,
						password:$('#password').val() 
					},
					dataType:'json'
				}
	 		)
	}
</script>
</body>
</html>